import MjPrefab from "../../component/MjPrefab"
import RandomUtil from "../../engine/RandomUtil"
import { GameConfig } from "../config/GameConfig"
import { UserModel } from "../model/UserModel"
import { AudioHelper } from "./AudioHelper"

export class MjAudioHelper {

    public static sendmahjong() {
        AudioHelper.playePathEffect("audio/mj/effect/out_mj")
    }

    public static enter() {
        AudioHelper.playePathEffect("audio/mj/effect/enter")
    }

    public static ting(sex:number) {
        let path: string = "audio/mjnew/"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "man/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "baoting" + id
        } else {
            path += "woman/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "baoting" + id
        }
        AudioHelper.playePathEffect(path)
    }

    public static gangshangkaihua(sex: number) {
        let path: string = "audio/mjnew/gang"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "/gangshangkaihua_1_1"
        } else {
            path += "/gangshangkaihua_1_2"
        }
        AudioHelper.playePathEffect(path)
    }

    public static gangshangpao(sex: number) {
        let path: string = "audio/mjnew/gang"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "/gangshangpao_1_1"
        } else {
            path += "/gangshangpao_1_2"
        }
        AudioHelper.playePathEffect(path)
    }

    public static qiangganghu(sex: number) {
        let path: string = "audio/mjnew/gang"
        let id: number = RandomUtil.nextInt(1, 2)
        path += "/qiangganghu_" + id + "_" + (sex + 1)
        AudioHelper.playePathEffect(path)
    }

    public static angang(sex: number) {
        let path: string = "audio/mjnew/"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "man/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "mendou" + id
        } else {
            path += "woman/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "mendou" + id
        }
        AudioHelper.playePathEffect(path)
    }

    public static zhuanwandou(sex:number){
        let path: string = "audio/mjnew/"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "man/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "zhuanwandou" + id
        } else {
            path += "woman/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "zhuanwandou" + id
        }
        AudioHelper.playePathEffect(path)
    }

    public static gang(sex: number) {
        let path: string = "audio/mjnew/"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "man/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "minggang" + id
        } else {
            path += "woman/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "minggang" + id
        }
        AudioHelper.playePathEffect(path)
    }

    public static hu(sex: number) {
        let path: string = "audio/mjnew/"
        if (sex == GameConfig.Sex_Type.Mail) {
            path += "man/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "hu" + id
        } else {
            path += "woman/"
            let id: number = RandomUtil.nextInt(1, 2)
            path += "hu" + id
        }
        AudioHelper.playePathEffect(path)
    }


   
}